﻿
@section CSS{
    <style>
    </style>
}

<div class="page-nav">首页 > 个人中心</div>
<div class="page-body">
    <div class="layui-tab  layui-tab-brief" lay-filter="layTab">
        <ul class="layui-tab-title" >
            <li class="layui-this">个人信息</li>
            <li lay-id="tab-updatepwd" onclick="">修改密码</li>
            <li lay-id="tab-logrecord" onclick="LogRecord.init()">登录记录</li>
        </ul>
        <div class="layui-tab-content">
            <div class="layui-tab-item layui-show">
                @await Component.InvokeAsync("PersonProfile")
            </div>
            <div class="layui-tab-item">
                @await Component.InvokeAsync("UpdatePassword")
            </div>
            <div class="layui-tab-item">
                @await Component.InvokeAsync("LogRecord")
            </div>
        </div>
    </div>
</div>


@section Scripts{
    <script>
        layui.use(['form', 'element'], function () {

            //url有参数，默认选中tab
            var element = layui.element;
            var tag = getQuery('tab');
            if (tag == "tab-updatepwd") {

            } else if (tag == "tab-logrecord") {
                LogRecord.init()
                element.tabChange('layTab', 'tab-logrecord');
            }

            
        });


        function getQuery(variable) {
            var query = window.location.search.substring(1);
            var vars = query.split("&");
            for (var i = 0; i < vars.length; i++) {
                var pair = vars[i].split("=");
                if (pair[0] == variable) { return pair[1]; }
            }
            return (false);
        }
    </script>
}
